package cn.rubintry.bug.hunting.common.http.viewmodel

import androidx.activity.ComponentActivity
import androidx.lifecycle.MutableLiveData
import cn.rubintry.bug.lib.network.http.viewmodel.BaseViewModel
import cn.rubintry.bug.hunting.common.http.api.WebApi
import cn.rubintry.bug.hunting.pojo.BaseModel
import cn.rubintry.bug.hunting.pojo.HomeBackgroundModel
import cn.rubintry.bug.lib.network.http.NetApiManager

class MineViewModel() : BaseViewModel() {

    val imageData =MutableLiveData<BaseModel<List<HomeBackgroundModel>>>()

    fun getHomeBackgroundImages(){
        request<WebApi, BaseModel<List<HomeBackgroundModel>>>(
            NetApiManager.getInstance().getApi(WebApi::class.java),
            WebApi::getHomeBackgroundImages,
            false,
            { data ->
                data?.let {
                    imageData.value = it
                }
            }
        )
    }
}